package tmall.common.util;

import tmall.common.dto.ResponseResult;
import tmall.common.exception.ReturnCode;

/**
 * 返回结果工具类
 * @author zhangservlet
 * @date 2020/11/20
 */
public class ApiRet {

    public static ResponseResult success(Object data){
        return new ResponseResult(data);
    }

    public static ResponseResult failed(String message){
        return new ResponseResult(message, ReturnCode.FAILED);
    }

    public static ResponseResult failed(String message, Integer code){
        return new ResponseResult(message, code);
    }

    public static ResponseResult success() {
        return new ResponseResult();
    }
}
